- if releases.present?
  = form_with model: channel, url: destroy_releases_channel_path(channel), method: :delete, \
    data: { controller: 'bulk-operation' } do |f|
    .card-body.p-0
      table.table.table-hover.table-bottom-borderless
        tr
          - if current_user&.manage?(app: channel.app) && !channel.app.archived
            th style="width: 10px"
              input type="checkbox" data-bulk-operation-target="checkboxAll"
          th = t('channels.show.version')
          th = t('channels.show.release_version')
          th = t('channels.show.build_version')
          - if channel.device_type.downcase == 'ios'
            th = t('channels.show.release_type')
          th = t('channels.show.git_branch')
          th.d-none.d-sm-table-cell = t('channels.show.git_commit')
          th = t('channels.show.uploaded_at')

          - releases.each_with_index do |release, index|
            tr
              - if current_user&.manage?(app: channel.app) && !channel.app.archived
                td
                  input [type="checkbox" name="channel[release_ids][]" value="#{release.id}"
                        data-bulk-operation-target="checkbox" data-action="bulk-operation#switchDeleteButton"]
              td
                = link_to release.version, friendly_channel_release_path(release.channel, release.id)
              td
                - if release.release_version == (params[:id] || params[:name])
                  = release.release_version || '-'
                - else
                  = link_to (release.release_version || '-'), friendly_channel_version_path(release.channel, release.release_version)
              td
                = release.build_version || '-'
              - if channel.device_type.downcase == 'ios'
                td
                  = release_type_url_builder(release)
              td
                = git_branch_url(release) || '-'
              td.d-none.d-sm-table-cell
                = git_commit_url(release.channel.git_url, release.git_commit) || '-'
              td
                span data-bs-toggle="tooltip" title="#{l(release.created_at, format: :nice)}"
                  = time_ago_in_words(release.created_at)

    - if @releases.total_pages > 1 || (current_user&.manage?(app: channel.app) && !channel.app.archived)
      .card-footer
        - if @releases.total_pages > 1
          .float-end
            = paginate @releases

        - if current_user&.manage?(app: channel.app)
          .actions
            .buttons
              = f.submit t('.delete'), class: 'btn btn-danger', \
                data: { bulk_operation_target: 'destroyButton', turbo_confirm: t('modals.confirm.body') }
- else
  .card-body
    = t('channels.show.empty_version')

